package com.eb.bi.common.util;

import java.net.URL;

public class CommonProcessor {
	public String getJarFileName() {
		URL url = this.getClass().getResource("");
		String path = url.getPath();
		String[] s = path.split("/");
		String jarName = "";
		for(String l : s){
			if(l.contains(".jar!")){
				jarName = l.replace(".jar!", "");
				break;
			}
		}
		return jarName;
	}
	public static String getCostTime(long beginTime , long endTime){
		if(String.valueOf(endTime - beginTime).length() <= 3){
			return "0";
		}else{
			return String.valueOf(endTime - beginTime);
		}
	}
	public static void main(String[] args){
		CommonProcessor CommonUtil = new CommonProcessor();
		System.out.println(CommonUtil.getJarFileName());
	}
}
